<h1><?php echo CHtml::encode(Yii::t('site','Register as a New User')); ?></h1>

<p>
<?php echo CHtml::encode(Yii::t('site','Please enter your user account information.')); ?>
<?php echo CHtml::encode(Yii::t('site','Click on [Submit].')); ?><br/>
<?php echo CHtml::encode(Yii::t('site','When your submission has been verified, you will receive a confirmation email.')); ?>
</p>

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
    'id'=>'user-form',
    'enableAjaxValidation'=>true,
    'focus'=>array($model,'lastName'),
)); ?>

    <p class="note"><?php echo Yii::t('site','Fields with {marker} are required.',array('{marker}'=>'<span class="required">*</span>')); ?></p>

    <?php echo $form->errorSummary($model); ?>

    <div class="row">
        <?php echo $form->labelEx($model,'lastName'); ?>
        <?php echo $form->textField($model,'lastName',array('size'=>60,'maxlength'=>128)); ?>
        <?php echo $form->error($model,'lastName'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model,'firstName'); ?>
        <?php echo $form->textField($model,'firstName',array('size'=>60,'maxlength'=>128)); ?>
        <?php echo $form->error($model,'firstName'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model,'salutation'); ?>
        <?php echo $form->dropDownList($model,'salutation',User::model()->salutationOptions,array('empty'=>Yii::t('site','(Select)'))); ?>
        <?php echo $form->error($model,'salutation'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model,'username'); ?>
        <?php echo $form->textField($model,'username',array('size'=>20,'maxlength'=>128)); ?>
        <?php echo $form->error($model,'username'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model,'password'); ?>
        <?php echo $form->passwordField($model,'password',array('size'=>15,'maxlength'=>128)); ?>
        <?php echo $form->error($model,'password'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model,'password2'); ?>
        <?php echo $form->passwordField($model,'password2',array('size'=>15,'maxlength'=>128)); ?>
        <?php echo $form->error($model,'password2'); ?>
    </div>

        <div class="row">
        <?php echo $form->labelEx($model,'email'); ?>
        <?php echo $form->textField($model,'email',array('size'=>60,'maxlength'=>128)); ?>
        <?php echo $form->error($model,'email'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model,'birthDate'); ?>
        <?php $this->widget('zii.widgets.jui.CJuiDatePicker', array(
                'model'=>$model,
                'name'=>'User[birthDate]',
                'value'=>Yii::app()->lc->toLocal($model->birthDate, 'date', 'medium'),                
                'language'=>Yii::app()->lc->getSelectedLanguageCalendar(),
                'options' => array('dateFormat'=>Yii::app()->locale->getDateFormat('calendar_small'),'changeMonth'=>true,'changeYear'=>true,'showButtonPanel'=>true),
                'htmlOptions' => array(/*'readonly'=>"readonly",*/'size'=>10,'maxlength'=>10,'class'=>'centered')
            )); ?>
        <?php echo $form->error($model,'birthDate'); ?>
    </div>

    <div class="row buttons">
        <?php $this->widget( 'application.extensions.button.DDButton',
            array(
                'title'=>Yii::t('site','Submit'),
                'linkTitle'=> Yii::t('site','Submit your user data'),
                'formID' => 'user-form',
                'buttonType' => 'save'
        )); ?>
        <?php $this->widget( 'application.extensions.button.DDButton',
            array(
                'title'=>Yii::t('site','Reset'),
                'linkTitle'=>Yii::t('site','Reset the form data'),
                'formID' => 'user-form',
                'buttonType' => 'reset',
                'confirm' => Yii::t('site','Really reset this form?')
        )); ?>
        <?php $this->widget( 'application.extensions.button.DDButton',
            array(
                'title'=>Yii::t('site','Cancel'),
                'linkTitle'=>Yii::t('site','Cancel registering, back to home page'),
                'formID' => 'user-form',
                'buttonType' => 'cancel',
                'url' => array('index')
        )); ?>
    </div>

<?php $this->endWidget(); ?>

</div><!-- form -->
